<title>全局设置</title>

<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">后台首页</a>
    <a><cite>后台设置</cite></a>
    <a><cite>全局设置</cite></a>
  </div>
</div>

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-header">全局设置</div>
        <div class="layui-card-body" pad15>
          <script type="text/html" template lay-url="/setting/system" lay-done="layui.form.render();">
            <div class="layui-form" style="padding: 20px 0 0 0;">
          <div class="layui-form-item">
            <label class="layui-form-label">网站名称</label>
            <div class="layui-input-inline">
              <input type="text" name="site_name" value="{{ d.data.system.site_name || '' }}"  lay-verify="required" placeholder="请输入...(必填)" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">该名称会以后缀形式显示在网站标题上</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">网站地址</label>
            <div class="layui-input-inline">
              <input type="text" name="base_url" value="{{ d.data.system.base_url || '' }}"  lay-verify="required" placeholder="请输入...(必填)" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-aux-word">指该网站的PC端访问网址，如：https://www.kandaoni.com，用来生成全站的绝对地址</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">移动端地址</label>
            <div class="layui-input-inline">
              <input type="text" name="mobile_url" value="{{ d.data.system.mobile_url || '' }}"  lay-verify="required" placeholder="请输入...(必填)" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-aux-word">指该网站的手机端访问网址，如：https://m.kandaoni.com，如果模板类型为PC+手机站，需要设置。</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">网站LOGO</label>
            <div class="layui-input-inline">
              <button type="button" class="layui-btn" id="site-logo">
                <i class="layui-icon">&#xe67c;</i>上传图片
              </button>
            </div>
            <div class="layui-form-mid">
              <input type="hidden" name="site_logo" value="{{ d.data.system.site_logo || '' }}" id="site-logo-input">
              <img src="{{ d.data.system.site_logo || '' }}" class="site-logo-img" id="site-logo-img"/>
            </div>
            <div class="layui-form-mid layui-word-aux">网站LOGO会显示在页头</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">备案号码</label>
            <div class="layui-input-inline">
              <input type="text" name="site_icp" value="{{ d.data.system.site_icp || '' }}" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">ICP备案查询地址：<a href="https://beian.miit.gov.cn/" target="_blank">beian.miit.gov.cn</a>，只需填主体备案号即可。没有则不填。</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">版权信息</label>
            <div class="layui-input-inline">
              <textarea class="layui-textarea" name="site_copyright" rows="3">{{ d.data.system.site_copyright || '' }}</textarea>
            </div>
            <div class="layui-form-mid layui-word-aux">版权信息会显示在页尾</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">模板风格</label>
            <div class="layui-input-inline">
              <select name="template_name">
                {{# layui.each(d.data.template_names, function(i, item){ }}
                <option value="{{item}}" {{# if(d.data.system.template_name == item){ }} selected="selected" {{# } }}>{{item}}</option>
                {{# }); }}
              </select>
            </div>
            <div class="layui-form-mid layui-word-aux"></div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">模板类型</label>
            <div class="layui-input-block">
              <input type="radio" name="template_type" value="0" title="自适应" {{ d.data.system.template_type == 0 ? 'checked' : '' }}>
                <input type="radio" name="template_type" value="1" title="代码适配" {{ d.data.system.template_type == 1 ? 'checked' : '' }}>
                <input type="radio" name="template_type" value="2" title="电脑+手机" {{ d.data.system.template_type == 2 ? 'checked' : '' }}>
            </div>
            <div class="layui-form-mid layui-word-aux">自适应类型模板只有一个域名和一套模板；代码适配类型有一个域名和2套模板，电脑端和手机端访问同一个域名会展示不同模板；电脑+手机类型需要2个域名和2套模板，访问电脑域名展示电脑模板，访问手机域名展示手机模板。</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">后台路径</label>
            <div class="layui-input-inline">
              <input type="text" name="admin_uri" value="{{ d.data.system.admin_uri || '' }}" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">可以自定义后台访问路径，减少被暴露概率。比如<cite>/manage</cite>。更改后需要重启才能生效</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">网站状态</label>
            <div class="layui-input-inline">
              <input type="radio" name="site_close" value="0" title="正常" {{ d.data.system.site_close != 1 ? 'checked' : '' }}>
              <input type="radio" name="site_close" value="1" title="闭站" {{ d.data.system.site_close == 1 ? 'checked' : '' }}>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">闭站提示</label>
            <div class="layui-input-inline">
              <textarea class="layui-textarea" name="site_close_tips" rows="3">{{ d.data.system.site_close_tips || '' }}</textarea>
            </div>
            <div class="layui-form-mid layui-word-aux">站点关闭后，将会显示上面的提示。支持html标签</div>
          </div>
          
          <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-inline">
              <input type="button" lay-submit lay-filter="system-submit" value="确认" class="layui-btn">
            </div>
          </div>
        </div>
        </script>
        </div>
      </div>
    </div>
  </div>
</div>

<script>
  layui.use('setting', layui.factory('setting'));
</script>